#ifndef __GROUP_MAP__H_
#define __GROUP_MAP__H_

#include "mytype.h"

#ifdef __cplusplus
extern "C"
{
#endif

#define GROUP_MAP_ERR_NONE 0x00
#define GROUP_MAP_ERR_NO_PROG -1
#define GROUP_MAP_ERR_POS_EE -2 
#define GROUP_MAP_ERR_GRP_EE -3 
#define GROUP_MAP_ERR_PHY_EE -4 
#define GROUP_MAP_ERR_PHY_RE -5 

	typedef struct
	{
		ii16 *p_phy_num_list; 
		uu16 group_amount;	  
		uu16 pos_amount;	  
		uu16 phy_max;		  
		uu08 fixed_head;	  

		ii08 err;
		uu16 group;
		uu16 pos;
		ii16 phy;
	} gp_map_st_type;

	void gp_map_reset(gp_map_st_type *list);
	void gp_map_creat(gp_map_st_type *list); 

	ii08 gp_map_next_pos(gp_map_st_type *list, uu16 group_now, uu16 pos_now);

	ii08 gp_map_fore_pos(gp_map_st_type *list, uu16 group_now, uu16 pos_now);

	ii08 gp_map_new_pos_req(gp_map_st_type *list, uu16 group);

	ii08 gp_map_get_phy(gp_map_st_type *list, uu16 group, uu16 pos);

	uint16_t gp_map_get_active_list(
		gp_map_st_type *list,
		uu16 group, uu16 pos,
		ii16 *act_list, uu16 act_len_max);

	ii08 gp_map_obj_add(gp_map_st_type *list, uu16 group, uu16 pos, uu16 phy);

	ii08 gp_map_obj_del(gp_map_st_type *list, uu16 group, uu16 pos);

#ifdef __cplusplus
}
#endif

#endif 
